package cn.xx.a;

import java.util.Scanner;

public class Test3 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("请输入被除数:");
        try { //有可能报错的代码
            int num1 = in.nextInt();
            System.out.print("请输入除数:");
            int num2 = in.nextInt();
            System.out.println(num1+"/"+ num2 +"="+ num1/num2);
        }catch (Exception e){
            System.err.println("输入的除数不是整数，重新输入");
            e.printStackTrace();  //抛出异常
//            System.exit(1);
        }finally {
            System.out.println("感谢使用本程序！");
        }
    }
}
